using DiLu.Expansion.File.Operates.LocalDisk.Configs;

namespace DiLu.Expansion.File.Operates.LocalDisk;

/// <summary>
///     删除本地磁盘文件夹
/// </summary>
public static class DeleteLocalDiskFolder
{
    /// <summary>
    ///     删除本地磁盘文件夹
    /// </summary>
    /// <param name="config">删除本地磁盘文件夹配置</param>
    public static async ValueTask DeleteAsync(this DeleteLocalDiskFolderConfig config)
    {
        if (!Directory.Exists(config.DirectoryFullPath)) return;
        await Task.Delay(0);
        Directory.Delete(config.DirectoryFullPath, true);
    }
}